[Top] [Prev] [Next] [Bottom] [Contents]

Sapphire Unplugged

In this section, we will be looking "inside" the Bookstore project to see how parts of it work. The project elements are described in more detail later in this manual. Feel free to skip this section and come back to it later-many of the concepts within will become clear once you've built a project yourself.

Let's begin at the beginning: the HTML that makes up our first page, home.html. Start by clicking the Document Manager icon in the Project Window (Fig. 2-4).

Figure 2-4 The Project Window

This brings up the Document Manager (Fig. 2-5). Select home.html from the HTML Documents list and click on the Edit HTML icon.

Figure 2-5 Document Manager

Your chosen editor should appear with home.html displayed. Most of this document is in basic HTML. Let's take a look at the link that we clicked on before: Book Search.

<A HREF="http://deiweb/~dei/cgi-bin/tut2/tut2.cgi?FNC=books__Ahome_html" >

<IMG SRC="http://deiweb/~dei/books.gif"></A><H3>Book Search</H3>


The <H3> and <IMG> tags should be familiar to you. The URL

http://deiweb/~dei/cgi-bin/tut2/tut2.cgi?FNC=books__Ahome_html

may look strange. It points to a CGI program on our server deiweb. The name of the CGI program is tut2.cgi; the part after the ? is an argument passed to the CGI, either as argv[1] or as the contents of the environment variable "QUERY_STRING". The argument tells the project CGI what to do-in this case, execute the function Abooks (represented in the URL as books__A) from the page home.html. The function Abooks gets its name from the way it is activated (by clicking on an anchor) and from the name of this particular anchor: books.

Note: Your HTML document source should list a slightly different URL from the example given above-your server name should replace deiweb, and your username should replace ~dei.
Now things are getting interesting. Let's see what Abooks does. Close the Document Manager (with File->Close) and go back to the Project Window. Scroll through the list of activators (Fig. 2-4). Select the activator home.html<A>books. Click the icon for Object Bind Editor (Selected Activator) (Fig. 2-4).

Figure 2-6 Object Bind Editor

Object Bind Editor

There's quite a lot of information in this window. You can see that there's a Data Object called CEZANNE|pubs2|BD_Get_Title_Types involved, and that this object is a DSQL. The bind that you're editing is called bind3. It so happens that my database server (CEZANNE) is a Sybase server (SYB).

Moving down to the middle section, you can see that the Arguments<=>Activator is home.html<A>books. The activator is named books, and is an anchor (<A>) on the page home.html.

In the bottom section, you can see that the Results<=>Template is books.html. What does this mean? Simply, that the results from the Data Object (BD_Get_Title_Types) will be inserted into the Data Sites in the HTML document books.html. The rest of the bottom section describes how this data should be formatted before being inserted into the data sites.

Summary

What is BD_Get_Title_Types? What does that big, red check mean? And what is an Object Binding, anyway? In the next chapters, you will learn how to create the Bookstore project and master many of the powerful features of Sapphire/Web.



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.